<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class ModifyImchatCooperativeEmployerUser extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('imchat', function (Blueprint $table) {
            $table->unsignedInteger('cooperative_employer_user')->nullable()->comment('合作商悬赏者(平台切换)');
        });

        Schema::table('imchat_message_log', function (Blueprint $table) {
            $table->unsignedInteger('cooperative_employer_user')->nullable()->comment('合作商悬赏者(平台切换)');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('imchat', function (Blueprint $table) {
            $table->dropColumn('cooperative_employer_user');
        });

        Schema::table('imchat_message_log', function (Blueprint $table) {
            $table->dropColumn('cooperative_employer_user');
        });
    }
}
